package com.bingfor.easycablelink.my.viewModel;

import android.content.Intent;

import com.bingfor.easycablelink.R;
import com.bingfor.easycablelink.account.LoginActivity;
import com.bingfor.easycablelink.base.BaseActivity;
import com.bingfor.easycablelink.my.AddressListActivity;
import com.bingfor.easycablelink.my.InvoiceInformationActivity;
import com.bingfor.easycablelink.my.ModifyPasswordActivity;
import com.bingfor.easycablelink.my.OrderListActivity;
import com.bingfor.easycablelink.my.ShoppingCartActivity;
import com.bingfor.easycablelink.widgets.ExitDialog;
import com.bingfor.easycablelink.widgets.ViewModel;

/**
 * Created by LY on 2017/5/17.
 */

public class PersonCenterViewModel implements ViewModel {


    public BaseActivity mContent;

    public PersonCenterViewModel(BaseActivity mContent) {
        this.mContent = mContent;
    }

    public void toNextPage(int id){
        switch (id){
            case 0:
                mContent.moveToNextPage(ShoppingCartActivity.class);
                break;
            case 1:
                mContent.moveToNextPage(OrderListActivity.class);
                break;
            case 2:
                mContent.moveToNextPage(InvoiceInformationActivity.class);
                break;
            case 3:
                mContent.moveToNextPage(AddressListActivity.class);
                break;
            case 4:
                mContent.moveToNextPage(ModifyPasswordActivity.class);
                break;
            case 5:
//                AlertDialog.Builder builder = DialogHelp.getDialog(mContent);
//                builder.setView(R.layout.dialog_exit);
//                builder.show();
//                Dialog dialog = new Dialog(mContent);
//                dialog.setContentView(R.layout.dialog_exit);
//                dialog.show();
//                WindowManager windowManager = mContent.getWindowManager();
//                Display display = windowManager.getDefaultDisplay();
//                WindowManager.LayoutParams lp = dialog.getWindow().getAttributes();
//                lp.width = (int)(display.getWidth()); //设置宽度
//                dialog.getWindow().setAttributes(lp);
                mContent.moveToNextPage(ExitDialog.class);

                break;
        }
    }
}
